#!/usr/bin/env pwsh
# git depends hash
# zlib nghttp2 openssl curl.

$ZLIB_VERSION = "1.2.11"
$ZLIB_HASH = "629380c90a77b964d896ed37163f5c3a34f6e6d897311f1df2a7016355c45eff"

$OPENSSL_VERSION = "1.1.1k"
$OPENSSL_HASH = "892a0875b9872acd04a9fde79b1f943075d5ea162415de3047c327df33fbaee5"

$NGHTTP2_VERSION = "1.43.0"
$NGHTTP2_HASH = "f4a9be08d22f5ad9b4bf36c491f1be58e54dc35a1592eaf4e3f79567e4894d0c"

# tar.gz
$CURL_VERSION = "7.75.0"
$CURL_HASH = "4d51346fe621624c3e4b9f86a8fd6f122a143820e17889f59c18f245d2d8e7a6"

$EXPAT_VERSION = "2.2.7"
$EXPAT_HASH = "30e3f40acf9a8fdbd5c379bdcc8d1178a1d9af306de29fc8ece922bc4c57bef8"

$GIT_VERSION = "2.35.4"
$GIT_HASH = "9afd7739d3645e081e290909fb8ed0709ea5626730e908eb8b5649d844c24ce9"

# Filename
$ZLIB_FILENAME = "zlib-${ZLIB_VERSION}"
$ZLIB_URL = "https://github.com/madler/zlib/archive/v${ZLIB_VERSION}.tar.gz"
#$ZLIB_URL = "https://www.zlib.net/zlib-${ZLIB_VERSION}.tar.gz"

$OPENSSL_URL = "https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz"
$OPENSSL_FILE = "openssl-${OPENSSL_VERSION}"

$NGHTTP2_URL = "https://github.com/nghttp2/nghttp2/archive/v${NGHTTP2_VERSION}.tar.gz"
$NGHTTP2_FILE = "nghttp2-${NGHTTP2_VERSION}"

$CURL_URL = "https://curl.haxx.se/download/curl-${CURL_VERSION}.tar.gz"
$CURL_FILE = "curl-${CURL_VERSION}"


# https://github.com/libexpat/libexpat/releases/download/R_2_2_7/expat-2.2.7.tar.xz
$EXPAT_URL = "https://github.com/libexpat/libexpat/releases/download/R_2_2_7/expat-${EXPAT_VERSION}.tar.xz"
$EXPAT_FILE = "expad-${EXPAT_VERSION}"

# https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.23.0.tar.xz
# "https://github.com/git/git/archive/v2.24.0.tar.gz"
$GIT_URL = "https://mirrors.edge.kernel.org/pub/software/scm/git/git-${GIT_VERSION}.tar.xz"
$GIT_FILE = "git-${GIT_VERSION}"


#curl-ca-bundle
$CA_BUNDLE_URL = "https://curl.haxx.se/ca/cacert-2020-07-22.pem"

Function DumpLocal {
    $dumptext = $ZLIB_VERSION + $ZLIB_HASH + $ZLIB_FILENAME + $ZLIB_URL
    + $OPENSSL_HASH + $OPENSSL_URL + $OPENSSL_FILE
    + $NGHTTP2_HASH + $NGHTTP2_URL + $NGHTTP2_FILE
    + $CURL_HASH + $CURL_FILE + $CURL_URL + $CA_BUNDLE_URL
    + $EXPAT_HASH + $EXPAT_FILE + $EXPAT_URL
    + $GIT_HASH + $GIT_FILE + $GIT_URL
    Write-Host $dumptext
}
